<template>
  <view v-if="$attrs.dataDetail" class="detailBox">
    <text class="text">#14</text>
    <view class="message">
      <view class="title">
        {{ $attrs.dataDetail.message }}
        <view class="imgBox">
          <image v-for="i in imgUrls" :key="i" :src="i" mode="widthFix" />
        </view>
      </view>

      <view v-if="$attrs.dataDetail.remark" class="content_box">
        {{ $attrs.dataDetail.remark }}
      </view>
      <view v-else class="none_remark">
        {{ t("Lang_WeWillReplyToYouAsSoonAsPossible：）") }}
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref, useAttrs, watch } from "vue";
const $attrs = useAttrs();
import { useI18n } from "vue-i18n";

const { t } = useI18n();
const imgUrls = ref([]);

watch(
  () => $attrs.dataDetail,
  (newVal) => {
    if (newVal && newVal.picUrl) {
      imgUrls.value = newVal.picUrl;
      console.log("imgUrls", imgUrls.value);
    }
  }
);
</script>

<style lang="scss" scoped>
.detailBox {
  margin-top: 20rpx;
  .text {
    color: #a7a7a7;
    margin-left: 20rpx;
  }
  .none_remark {
    margin-top: 20rpx;
    color: rgba(172, 172, 172, 0.85);
  }
}
.message {
  background: #fff;
  width: 95%;
  width: calc(100% - 20rpx);
  margin: 40rpx auto;
  margin-top: 20rpx;
  border: 1px solid #ccc;
  border-radius: 10rpx;
  padding: 20rpx;
  box-sizing: border-box;

  .title {
    padding: 10rpx 0 20rpx;
    border-bottom: 1px solid #ccc;
    font-size: 30rpx;
    word-break: break-all;
  }
  .imgBox {
    display: flex;
    image {
      margin-top: 20rpx;
      width: 80rpx;
      height: 80rpx;
      border-radius: 10rpx;
    }
  }

  .content_box {
    font-size: 28rpx;
    min-height: 80rpx;
    margin-top: 20rpx;

    .item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 20rpx;

      .content {
        display: flex;
        align-items: center;

        .num {
          color: #a19e9e;
          width: 55rpx;
        }

        .text {
        }

        .time {
          margin-left: 15rpx;
          color: #a19e9e;
          font-size: 24rpx;
        }

        .active {
          color: #ff0404;
        }
      }
    }
  }
}
</style>
